export interface User {
  id: string
  name: string
  department: string
  position: string
  email: string

  // 可选字段，来自API的原始数据
  userId?: string
  userName?: string
  deptName?: string
  deptId?: string
  jobName?: string
  mail?: string
  avatar?: string
  phone?: string
  mobile?: string
}

export interface UserTableInstance {
  clearSelection: () => void
  toggleAllSelection: () => void
  getSelection: () => User[]
  unselectRow: (userId: string) => void
  toggleRowSelection: (row: User, selected?: boolean) => void
}

export interface TreeNode {
  id: string | number
  name: string
  parentId?: string | number
  departmentsId?: string | number
  level?: string | number
  shortName?: string
  corpName?: string
  hasChildren?: boolean
  isLeaf?: boolean
  children?: TreeNode[]
  isExternal?: boolean
  parentPath?: string
}

// API响应类型
export interface ApiResponse<T> {
  code: number
  message: string
  result: T
}

export interface PaginatedResult<T> {
  count: number
  rows: T[]
}
